<nav class="navbar navbar-default" style="margin-bottom: 5px;">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="<%= root_url %>"><%= t :app_name %></a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <% if user_signed_in? %>
          <ul class="nav navbar-nav">
            <li><%= link_to '销售记录', sales_path %></li>
            <li><%= link_to '客户', customers_path %></li>
            <li><%= link_to '产品', products_path %></li>
            <li><%= link_to '员工', staffs_path %></li>
          </ul>
      <% end %>

      <ul class="nav navbar-nav navbar-right">
        <% if user_signed_in? %>
            <li>
              <%= link_to '个人设置', profile_staffs_path %>
            </li>
            <li>
              <%= link_to '修改密码', password_staff_path(current_user) %>
            </li>
            <li>
              <%= link_to '退出', destroy_user_session_path, method: :delete %>
            </li>
        <% else %>
            <li><%= link_to '登陆', new_user_session_path %></li>
            <li><%# link_to '注册', new_user_registration_path %></li>
        <% end %>
      </ul>

      <% if user_signed_in? %>
          <p class="navbar-text navbar-right">欢迎 <%= current_user.name || current_user.email %></p>
      <% end %>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
